home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
gnustuff
/
tos
/
othergnu
/
ispell.zoo
/
hash.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1990-03-06
|
350 b
|
28 lines
/* -*- Mode:Text -*- */
/*
* hash.c - a simple hash function for ispell
*
* Pace Willisson, 1983
*/
hash (s, n, hashsize)
register char *s;
register n;
register hashsize;
{
register short h = 0;
while (n--) {
h ^= *s++;
if (h < 0) {
h <<= 1;
h++;
} else {
h <<= 1;
}
}
h &= 077777;
return (unsigned long) h % hashsize;
}